﻿// <copyright file="LoadGeographicalDataStep.cs" company="QUT">
//     Copyright (c) QUT. All rights reserved.
// </copyright>

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GenerateKml.Steps
{
    /// <summary>
    /// Load Geographical Data Step.
    /// </summary>
    public partial class LoadGeographicalDataStep : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="LoadGeographicalDataStep"/> class.
        /// </summary>
        public LoadGeographicalDataStep()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Gets the map info MID file path.
        /// </summary>
        /// <value>The map info MID file path.</value>
        public string MapInfoMIDFilePath
        {
            get
            {
                return this.MapInfoMIDFileTextBox.Text;
            }
        }

        /// <summary>
        /// Gets the map info MIF file path.
        /// </summary>
        /// <value>The map info MIF file path.</value>
        public string MapInfoMIFFilePath
        {
            get
            {
                return this.MapInfoMIFFileTextBox.Text;
            }
        }

        /// <summary>
        /// Handles the Click event of the BrowseMapInfoMIDFileButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BrowseMapInfoMIDFileButton_Click(object sender, EventArgs e)
        {
            this.MainOpenFileDialog.Filter = "MapInfo Data (*.mid)|*.mid|All files (*.*)|*.*";
            this.MainOpenFileDialog.FileName = string.Empty;
            if (this.MainOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                this.MapInfoMIDFileTextBox.Text = this.MainOpenFileDialog.FileName;
            }
        }

        /// <summary>
        /// Handles the Click event of the BrowseMapInfoMIFFileButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BrowseMapInfoMIFFileButton_Click(object sender, EventArgs e)
        {
            this.MainOpenFileDialog.Filter = "MapInfo File (*.mif)|*.mif|All files (*.*)|*.*";
            this.MainOpenFileDialog.FileName = string.Empty;
            if (this.MainOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                this.MapInfoMIFFileTextBox.Text = this.MainOpenFileDialog.FileName;
            }
        }
    }
}
